package com.bbcare.followup.plat.service.impl;

import com.bbcare.followup.plat.entity.FuReferralReturnRecord;
import com.bbcare.followup.plat.service.FuReferralReturnRecordService;
import com.bbcare.followup.plat.store.ibatis.FuReferralReturnRecordDao;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @Title		FuReferralReturnRecordServiceImpl.java
 * @Package		com.bbcare.followup.plat.service.impl
 * @Description	患者转诊-转回记录接口业务实现类
 * @Author		<a href="mailto:jiangqian_java@163.com">jiang</a>
 * @Date		2022/9/20
 * @Version		V1.0 
 * @Copyright	(c) Shanghai BBcare Medical Equipment Co.,Ltd.
 */
@Service
public class FuReferralReturnRecordServiceImpl implements FuReferralReturnRecordService {

    @Resource
    private FuReferralReturnRecordDao fuReferralReturnRecordMapper;


    @Override
    public Object insert(FuReferralReturnRecord fuReferralRecord) {
        return fuReferralReturnRecordMapper.insert(fuReferralRecord);
    }


    @Override
    public Object delete(int id) {
        return fuReferralReturnRecordMapper.delete(id);
    }


    @Override
    public Object update(FuReferralReturnRecord fuReferralRecord) {
        return fuReferralReturnRecordMapper.update(fuReferralRecord);
    }


    @Override
    public FuReferralReturnRecord load(String id) {
        return fuReferralReturnRecordMapper.load(id);
    }


    @Override
    public Map<String,Object> pageList(int offset, int pagesize) {

        List<FuReferralReturnRecord> pageList = fuReferralReturnRecordMapper.pageList(offset, pagesize);
        int totalCount = fuReferralReturnRecordMapper.pageListCount(offset, pagesize);

        // result
        Map<String, Object> result = new HashMap<String, Object>();
        result.put("pageList", pageList);
        result.put("totalCount", totalCount);

        return result;
    }

}